import { number } from 'prop-types';

export interface IProps {
  global: any;
  buttonPermissions: any;
  contractManagement: any;
  menuCode: string;
}

export interface IOptionType {
  label?: string;
  value?: string | number;
  disabled?: boolean;
  checked?: boolean;
  children?: IOptionType[];
}

export interface IStatusFirstOptionType extends IOptionType {
  color?: string;
  logoType?: ILogoType;
  class: string;
}
export interface IExecuteStatusOptionType extends IOptionType {
  label: string;
  class: string;
  detail: boolean;
}
export interface IOrginDealElementOptions {
  id?: number;
  label?: string;
  value?: string;
  children?: IOrginDealElementOptions[];
}

export interface IDealElementOptions {
  id?: number;
  key?: string;
  label?: string;
  parentKey?: number;
  regionId?: string;
  title: string;
  value?: string;
  children?: IDealElementOptions[];
}

export type IDealElementDataObj = Record<number, IDealElementOptions[]>;

export interface IStationsData {
  dealElementOptions: IDealElementOptions[];
  dealElementModalOptions: IDealElementOptions[];
  dealElementDataObj: IDealElementDataObj;
  originDealElementOptions?: IOrginDealElementOptions[];
}

export interface IFormValue {
  quantityQuotation?: number; //报量报价
  provinceName?: string; //省名称
  stationName?: string; //场站名称
  provinceId?: string; //省ID
  marketId?: string; //交易中心ID
  calendarDate?: string; // 日期
  stationId?: string; //交易单元ID
  reset?: IResetType; // 是否重置
  saveType?: number; //数据渠道
}

export interface IAdjustPolicyEditingListType {
  beginIndex?: number;
  beginTime?: string;
  dataSourceId?: number;
  endIndex?: number;
  endTime?: string;
  fixedValue?: number;
  masterId?: number;
  maxValue?: number;
  minValue?: number;
  rateValue?: number;
  timeSlot?: string;
  useType?: IUseType;
}

export interface IPostQueryPriceDiffCurveParamsType {
  baseValue?: IBaseValueType;
  calendarDate?: string; //日期
  correction?: ICorrectionType;
  startDate?: string; // 开始日期
  endDate?: string; // 结束日期
  provinceId?: string; //省ID
  sourceType?: ISourceType;
  stationId?: string; // 交易单元ID
  valueType?: IValueType;
  baseValueText?: string;
}

export interface IPriceDiffCurveType {
  basePersent?: ITimeOrderValueType[]; //基数比例预测
  dayAheadForecastPrice?: ITimeOrderValueType[]; // 现货日前价预测
  dayAheadPrice?: ITimeOrderValueType[]; // 现货日前过渡价预测
  dayAheadPriceDiff?: ITimeOrderValueType[]; // 现货日前过渡实时价差
  priceDiffbelieve?: ITimeOrderValueType[]; // 价差置信度
  realTimeDayAheadPriceDiff?: ITimeOrderValueType[]; // 现货实时日前价差
  realTimePrice?: ITimeOrderValueType[]; //现货实时价预测
}

export interface IPriceDiffCurveDataType {
  noBaseBefore?: IPriceDiffCurveType; //无基数-修正前
  noBaseAfter?: IPriceDiffCurveType; //无基数-修正后
  baseBefore?: IPriceDiffCurveType; // 有基数-修正前
  baseAfter?: IPriceDiffCurveType; //有基数-修正后
  startDate?: string; // 山西有基数截断月内开始日期
  endDate?: string; // 山西有基数截断月内结束日期

  newChartData?: IPriceDiffCurveType; // 修改接口后没有以上有无基数和修正后状态 新增一个对象与以上做一个区分
}

export interface IPostQueryForecastAndSimulateParamsType {
  dataList?: IDataListType[]; // 比例数据集合
  markDate?: string; // 标的日期
  quoteStationId?: number | string; // 引用的结算单元
  smoothStatus?: ISmoothStatusType | null; //算法
  stationId?: number; // 结算单元
  store?: IStoreType; // 是否考虑储能
}

export interface IPostQueryForecastAndSimulateParamsNewType {
  dataFrom?: number; // 数据来源
  dataList?: IDataListType[]; // 比例数据集合
  markDate?: string; // 标的日期
  quoteStationId?: number | string; // 引用的结算单元
  smoothStatus?: ISmoothStatusType | null; //算法
  stationId?: number; // 结算单元
  store?: IStoreType; // 是否考虑储能
}

export interface IDataListType {
  beginIndex?: number;
  dataSourceId?: number | string;
  endIndex?: number;
  fixedValue?: number | string;
  masterId?: number | string;
  maxValue?: number | string;
  minValue?: number | string;
  rateValue?: number | string;
  timeSlot?: string;
  useType?: IUseType;
  beginTime?: string;
  endTime?: string;
  id?: number;
}

export interface IAdjustPolicyEditingDataType {
  dataSourceList?: IAdjustPolicyEditingSourceDataListType[];
  dataList?: IDataListType[];
}

export interface IAdjustPolicyEditingSourceDataListType {
  masterId?: number;
  dataSourceId?: number;
  dataSourceName?: string;
}

export interface IComponentsIsLoadingType {
  priceDiffCurveIsLoading?: boolean;
  forecastAndSimulateIsLoading?: boolean;
  adjustPolicyEditingIsLoading?: boolean;
  adjustPolicyEditingIsButtonLoading?: boolean;
  strategicBenefitEstimationIsLoading?: boolean;
  strategicBenefitEstimationAiIsLoading?: boolean;
  aiForecastIsLoading?: boolean;
  resetButIsLoading?: boolean;
}

export interface IComponentsIsErrorType {
  priceDiffCurveIsError?: boolean;
  forecastAndSimulateIsError?: boolean;
  adjustPolicyEditingIsError?: boolean;
  strategicBenefitEstimationIsError?: boolean;
  strategicBenefitEstimationAIIsError?: boolean;
  forecastAndSimulateFail?: boolean;
}

export interface IPostQueryShortForecastCurveAdjustmentParamsType {
  adjustmentId?: number; //调整后数据ID
  endDate?: string; // 查询结束时间
  forecastId?: number; // 预测数据ID
  issueRateId?: number; // 比例数据ID
  startDate?: string; // 查询开始时间
  stationId?: string; //结算单元ID
  executeStatus?: IExecuteStatusType; //执行状态
  unit?: IUnitType;
  side?: ISideType;
  provinceId?: string | number;
}

export interface IQueryIssuePlanListDataType {
  issueTime?: string; //申报时间
  dataSourceName?: number; //下发主站
  executeStatus?: IExecuteStatusType; //执行状态  0:未执行    1：已执行
  statusFirst?: IStatusFirstType; //执行反馈    1：下发成功， 2：下发成功 0：失败
  statusLast?: IStatusLastType; //校验反馈  1：校验成功   2：未校验  0：校验失败
  forecastId?: number; //预测数据ID
  adjustmentId?: number; //调整后数据ID
  issueRateId?: number; //调整比例ID
  id?: number;
}

export interface IPostFindStrategyPriceForecastParamsType {
  adjustmentElectric?: number[]; // 调整后电量
  calendarDate?: string; // 日期
  priceDiffbelieve?: number[]; // 价差置信度
  provinceId?: string; // 省ID
  rateList?: IDataListType[]; //比例数据集合
  realTimeDayAheadPriceDiff?: number[]; //现货实时日前过渡价差/现货实时日前价差
  realTimePrice?: number[]; //实时价格预测
  stationId?: string; //交易单元ID
  smoothStatus?: ISmoothStatusType | null;
  dayAheadForecastPrice?: number[];
  basePersent?: number[];
  forcastPower?: number[];
}

export interface IShortForecastCurveAdjustmentDataType {
  corlor?: string;
  dataSourceId?: number;
  dataSourceName?: string;
  pointList: Record<string, IPointListType[]>;
}

export interface IPostFindAIRateDataParamsType extends IFormValue {
  realTimePrice?: number[]; //实时价格预测
  dayAheadForecastPrice?: number[];
  adjustmentElectric?: number[];
  basePersent?: number[];
  baseValue?: IBaseValueType;
  forcastPower?: number[];
}

export interface IPointListType {
  xAxis?: string;
  value?: string | number | null;
  color?: string | null;
}

export interface IPostFindOperationLogParamsType {
  markDate?: string;
  stationId?: string;
  type?: number;
}

export interface ITimeOrderValueType {
  timeOrder?: number | string;
  value?: number | string;
}

export interface IFindOperationLogDataType {
  operationTime?: string;
  operationIssue?: string;
  operationUser?: string;
  rateType?: string;
  smoothStatus?: ISmoothStatusType;
  dataList?: IFindOperationLogDataListType[];
  isSpread?: boolean;
  id: number;
}

export interface IFindOperationLogDataListType {
  time?: string;
  useType?: IUseType;
  dataSourceName?: string;
  fixation?: string;
  max?: string;
  min?: string;
  rateValue?: string;
}

export interface IDataSourceListType {
  dataSourceId?: number;
  dataSourceName?: string;
  masterId?: number;
}

export interface IForecastAndSimulateDataType {
  dataSource?: string;
  dataSourceId?: number;
  values?: number[];
  dataList?: IFindOperationLogDataListType[];
}

export enum ITitleType {
  STRATEGIC_BENEFIT_ESTIMATION = 'StrategicBenefitEstimation', // 策略效益预估
  DECLARE_PLAN = 'DeclarePlan', // 申报计划
  DECLARE_DETAIL = 'DeclareDetail', // 申报详情
  STATUS_FIRST = 'statusFirst', // 执行反馈
  ADJUST_POLICY_EDITING = 'adjustPolicyEditing', // 调整策略编辑
  POWER_PREDICTION_AND_ADJUSTMENT_SIMULATION = 'powerPredictionAndAdjustmentSimulation', // 功率预测及调整模拟
  AISTRATEGY = 'aiStrategy', // AI推荐策略-风险增量(元)
  CURRENTSTRATEGY = 'currentStrategy', //当前策略-风险增量(元)
  STATUS_SECOND = 'statusSecond', // 申报校验
  STATUS_LAST = 'statusLast', // 出清校验
  STATUS_EXECUTE = 'statusExecute', // 执行状态
}

export interface IFindStrategyPriceForecastDataType {
  [ITitleType.AISTRATEGY]?: IFindStrategyPriceForecastItemType;
  [ITitleType.CURRENTSTRATEGY]?: IFindStrategyPriceForecastItemType;
}

export enum IStrategyBenefitDetailKeyType {
  TOTAL = 'total', // 总计
  PRICE_DIFFF_ORECAST = 'priceDiffForecast', //价差预估
  PRICE_DIFF_BELIEVE = 'priceDiffbelieve', //价差置信度
  SIM_ADJUSTMENT = 'simAdjustment', // 发电量拟调整
  EARNINGS = 'earnings', // 收益变动预估
  RISK = 'risk', //调整风险
}

export interface IFindStrategyPriceForecastItemType {
  [IStrategyBenefitDetailKeyType?.EARNINGS]?: (number | null | string)[];
  [IStrategyBenefitDetailKeyType.PRICE_DIFFF_ORECAST]?: (number | null | string)[];
  [IStrategyBenefitDetailKeyType.PRICE_DIFF_BELIEVE]?: (number | null | string)[];
  [IStrategyBenefitDetailKeyType?.RISK]?: (number | null | string)[];
  [IStrategyBenefitDetailKeyType.SIM_ADJUSTMENT]?: (number | null | string)[];
  [IStrategyBenefitDetailKeyType.TOTAL]?: {
    [IStrategyBenefitDetailKeyType?.EARNINGS]?: null | string | number;
    [IStrategyBenefitDetailKeyType.PRICE_DIFFF_ORECAST]?: null | string | number;
    [IStrategyBenefitDetailKeyType.PRICE_DIFF_BELIEVE]?: null | string | number;
    [IStrategyBenefitDetailKeyType?.RISK]?: null | string | number;
    [IStrategyBenefitDetailKeyType.SIM_ADJUSTMENT]: null | string | number;
  };
}

export interface IFindStrategyPriceForecastListType {
  timeOrder: string;
  [IStrategyBenefitDetailKeyType?.EARNINGS]?: number | null | string;
  [IStrategyBenefitDetailKeyType?.RISK]?: number | null | string;
  [IStrategyBenefitDetailKeyType.SIM_ADJUSTMENT]?: number | null | string;
  [IStrategyBenefitDetailKeyType.PRICE_DIFFF_ORECAST]?: number | null | string;
  [IStrategyBenefitDetailKeyType.PRICE_DIFF_BELIEVE]?: number | null | string;
}

export interface IPostFindQuoteStationDataParamsType {
  menuCode?: string;
  stationId?: number | string;
}

export interface IQuoteStationDataType {
  stationId?: number; // 结算单元id
  stationName?: string; // 结算单元名称
}

export interface IColumnsKeysList {
  code: IColumnsKeyType;
  name?: string;
  width?: number;
  lock?: boolean;
  persion?: number;
  hintText?: string;
}

export interface IReferenceStrategyDataType {
  quoteDataList: IDataListType[];
  quoteStationId?: string | number;
}

export interface IChartsLineType {
  name: string;
  color?: string;
  persion?: number;
  code?: string;
  type?: IBaseValueType;
}

export enum IBaseValueType {
  NO_BASE = 0, //无基数
  BASE = 1, //有基数
}

export enum ICorrectionType {
  BEFORE = 'before', // 修正前
  AFTER = 'after', // 修正后
}

export enum ISourceType {
  TIAN_JI = 'tianji', // 天机预测
  HISTORY = 'history', // 历史统计
}

export enum IValueType {
  MEAN_VALUE = 1, // 均值
  MIN_NUM = 2, //最小值
  Q1 = 3, // Q1
  MEDIAN = 4, // 中位数
  Q3 = 5, // Q3
  MAX_NUM = 6, // 最大值
}

export enum IShorttermForecastingRedesignPermissions {
  EXPORTBUTTON = 'IteraShortTermForcastExportButtton', // 导出
  SAVEBUTTON = 'IteraShortTermForcastSaveButtton', // 保存
}

export enum IStepsType {
  STRATEGY = '1', // 策略制定
  DECLARE_TO_PERFORM = '2', // 申报执行
  DEVIATION_ANALYSIS = '3', // 偏差分析
}

export enum IExecuteStatusType {
  NON_EXECUTION = 0, // 未执行
  EXECUTED = 1, // 已执行
  SUCCESS = 2, //已成功
  UNADJUSTED = 3, //无调整
  PARTIALSUCCESS = 4, //部分成功
  DATEERROR = 5, //日期错误
  ERROR = 6, //失败
  ADJUSTED = 7, //已调整
}

export enum IStatusFirstType {
  SUCCESS_ONE = 1, // 下发成功
  SUCCESS_TWO = 2, // 下发成功
  FAIL = 0, // 失败
  NONE = 3, // 没有下发
}

export enum IStatusLastType {
  CHECK_SUCCESS = 1, // 校验成功
  NOT_CHECK = 2, // 未校验
  CHECK_FAIL = 0, // 校验失败
}

export enum IStatusSecondType {
  NONE = 0, // 没有下发
  FAIL = 2, // 失败
  SUCCESS = 1, // 成功
}

export enum ILogoType {
  CHECKCIRCLEOUTLINED = 'CheckCircleOutlined', // 成功
  CLOSECIRCLEOUTLINED = 'CloseCircleOutlined', // 失败
}

export enum IDeclareDetailDataChannelType {
  POWER = 'power', // 功率
  ELECTRICITY = 'electricity', // 电量
}

export enum ISmoothStatusType {
  KALMAN = 'kalman', // MODEL 1
  BEZIER = 'gaussian', // MODEL 2
  NONE = 'none', // NONE
}

export enum IUseType {
  FIXATION = 'fixation', // 固定值
  DATASOURCE = 'dataSource', // 预测源
}

export enum IStoreType {
  CONSIDER = 1, // 考虑储能
  NO_CONSIDER = 0, // 不考虑储能
}

export enum IUnitType {
  POWER_UNIT = 'MW', //功率
  ELECTRICITY_UNIT = 'MWh', // 电量
}

export type IPointerType = IBaseValueType | ICorrectionType | IStoreType;

export enum IDeclareDetailChartsLineType {
  LINE_ONE = '基数', // 基数
  LINE_TWO = '市场化中长期', // 市场化中长期
  LINE_THREE = '调整方式', // 调整方式
  LINE_FOUR = '调整依据', // 调整依据
  LINE_FIVE = '调整参数', // 调整参数
  LINE_SIX = '申报主站', // 申报主站
  LINE_SEVEN = '申报调度', // 申报调度
  LINE_EIGHT = '理论功率', // 理论功率
  LINE_NINE = '实际出力', // 实际出力
  LINE_TEN = '日前出清电价', // 日前出清电价
  LINE_ELEVEN = '实时出清电价', // 实时出清电价
  LINE_TWELVE = '日前出清功率', //日前出清功率
}

/* export enum IForecastAndSimulateChartsLineType {
  LINE_FOUR = 'basePower', //基数
  LINE_FIVE = 'midLongPower', //中长期
  LINE_ONE = 'rateList', // 调整比例
  LINE_TWO = 'adjustmentElectric', //交易单元预测出力模拟调整结果
  LINE_THREE = 'resultPower', // 电量
  LINE_SIX = 'settlePower', // 结算端功率预测源
} */

export enum IForecastAndSimulateChartsLineType {
  LINE_ONE = '调整比例', // 调整比例
  LINE_TWO = '交易单元出力预测结果',
  LINE_FIVE = '市场化中长期', //中长期
}

export enum IUserAndSimulateChartsLineType {
  /*
  交易单元出力预测结果
  手动策略调整结果-策略简称
  手动策略调整平滑结果-策略简称
  调整比例
  */
  LINE_ONE = '调整比例', // 调整比例
}

export enum IColumnsKeyType {
  PRICE_DIFFF_ORECAST = 'priceDiffForecast', //价差预估
  PRICE_DIFF_BELIEVE = 'priceDiffbelieve', //价差置信度
  SIM_ADJUSTMENT = 'simAdjustment', // 发电量拟调整
  EARNINGS = 'earnings', // 收益变动预估
  RISK = 'risk', //调整风险
  TIME_ORDER = 'timeOrder',
}

export enum IEableType {
  EDIT = 'edit', // 编辑状态
  DETAIL = 'detail', // 详情状态
}

export enum IPriceDiffCurveChartsLineType {
  LINE_ONE = 'dayAheadForecastPrice', //现货日前价预测
  LINE_TWO = 'realTimePrice', //现货实时价预测
  LINE_THREE = 'realTimeDayAheadPriceDiff', //现货实时日前价差
  LINE_FOUR = 'priceDiffbelieve', // 价差置信度
  LINE_FIVE = 'basePersent', //基数比例预测
  LINE_SIX = 'dayAheadPrice', // 现货日前过渡价预测
  LINE_SEVEN = 'dayAheadPriceDiff', // 现货实时日前过渡价差
}

export enum IResetType {
  RESET = 1, // 重置
  NO_RESET = 0, // 不重置
}

export enum ISideType {
  GENERATE = 'generate', //发电端
  SETTLE = 'settle', //结算端
}
export interface IPostQueryAllIssuePlanListParamsType {
  dataSourceList?: number[];
  endDate?: string;
  startDate?: string;
  stationList?: string[];
  statusFirst?: string[];
  statusLast?: string[];
}

export interface IAllIssuePlanListDataType {
  issueDate?: string;
  provinceIssuePlanList?: [
    {
      provinceName?: string;
      stationIssuePlanList?: [
        {
          dataSourceName?: string;
          issueTime?: string;
          operationUser?: string;
          stationName?: string;
          executeStatus?: IExecuteStatusType; //执行状态  0:未执行    1：已执行
          statusFirst?: IStatusFirstType; //执行反馈    1：下发成功， 2：下发成功 0：失败
          statusLast?: IStatusLastType; //校验反馈  1：校验成功   2：未校验  0：校验失败
        },
      ];
    },
  ];
}

export interface IAllIssuePlanListType {
  issueDate?: string;
  provinceName?: string;
  dataSourceName?: string;
  issueTime?: string;
  operationUser?: string;
  stationName?: string;
  executeStatus?: IExecuteStatusType; //执行状态  0:未执行    1：已执行
  statusFirst?: IStatusFirstType; //执行反馈    1：下发成功， 2：下发成功 0：失败
  statusLast?: IStatusLastType; //校验反馈  1：校验成功   2：未校验  0：校验失败
  provinceIndex?: string; // 用于处理省份合并的数据
  stationIndex?: string; // 用于处理交易单元合并的数据
}
